package com.zhu.tool_test.mock;


import org.hamcrest.Matcher;
import org.springframework.test.web.servlet.ResultMatcher;
import org.springframework.test.web.servlet.result.ContentResultMatchers;

/**
 * @program: tool_test
 * @description: 结果匹配器
 * @author: ggBall
 * @create: 2020-12-25 11:30
 **/
public class GgToolContentResultMatchers extends ContentResultMatchers {
    /**
     * Assert the response body content with a Hamcrest {@link Matcher}.
     * <pre class="code">
     * mockMvc.perform(get("/path"))
     *   .andExpect(content().string(containsString("text")));
     * </pre>
     *
     * @param matcher
     */
    @Override
    public ResultMatcher string(Matcher<? super String> matcher) {
        return super.string(matcher);
    }

    /**
     * Assert the response body content as a String.
     *
     * @param expectedContent
     */
    @Override
    public ResultMatcher string(String expectedContent) {
        return super.string(expectedContent);
    }
}
